﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace ASP.NET.Samples
{
    public partial class Eg_Request : System.Web.UI.Page
    {
        protected string RequestMemberInfo;
        protected void Page_Load(object sender, EventArgs e)
        {
            //var url = "http://social.msdn.microsoft.com/Search/zh-CN?query=request&emptyWatermark=true&ac=2";
            //Response.Redirect(url);
            DisplayRequestMemberInfo();
        }

        private void DisplayRequestMemberInfo()
        {
            var memberInfo = new StringBuilder();
            memberInfo.AppendFormat("请求类型：{0}\r\n", HttpContext.Current.Request.RequestType);
            memberInfo.AppendLine();
            memberInfo.AppendFormat("请求原始的URL：{0}\r\n", HttpContext.Current.Request.RawUrl);
            memberInfo.AppendFormat("导致当前请求的上一个请求地址：{0}\r\n", HttpContext.Current.Request.UrlReferrer);
            
            RequestMemberInfo = memberInfo.ToString();
        }
    }
}